import request from "../utils/request";
//登录页
export const checkLogin = (data: any) => {
    return request(
        {
            url: '/users/checkLogin',
            method: 'post',
            data
        }
    )
}
export const addAccount = (data: any) => {
    return request(
        {
            url: 'users/add',
            method: 'post',
            data
        }
    )
}
//用户列表
export const getAccountList = (params: any) => {
    return request(
        {
            url: 'users/list',
            method: 'get',
            params
        }
    )
}
//删除用户
export const deleteAccount = (params: any) => {
    return request(
        {
            url: 'users/del',
            method: 'get',
            params
        }
    )
}
//批量删除账号
export const batchdelAccount = (params: any) => {
    return request(
        {
            url: 'users/batchdel',
            method: 'get',
            params
        }
    )
}
// 修改账号
export const editAccount = (data: any) => {
    return request({
        url: 'users/edit',
        method: 'post',
        data
    })
}
//修改密码
export const editpassword = (data: any) => {
    return request({
        url: '/users/editpwd',
        method: 'post',
        data
    })
}
//检查旧密码是否正确
export const checkoldPwdAccount = (params: any) => {
    return request({
        url: 'users/checkoldpwd',
        method: "get",
        params
    })
}
//获取个人信息
export const getUserInfo = () => {
    return request({
        url: 'users/info',
        method: "get",
    })
}
//上传头像
export const uploadAvatar = (data: any) => {
    return request({
        url: 'users/avatar_upload',
        method: 'post',
        data
    })
}
//修改用户头像
export const modifyAvatar = (params: any) => {
    return request(
        {
            url: 'users/avataredit',
            method: 'get',
            params
        }
    )
}